package com.shushan.setting.bean;

import com.android.net.bean.NetBaseBean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @ClassName: BookBean
 * @Desciption: 出版社课本bean
 * @author: yichaohua
 * @date: 2018-08-10
 */
public class BookBean extends NetBaseBean{

    public int id;
    public int grade_id;
    public String grade_name;
    public String semester;
    public int subject_id;
    public String subject_name;
    public int press_id;
    public String press_name;
    public String press_desc;
    public String cover;
    public int level;
    public String level_json;
    public int defaultPress;

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        id = jsonObject.optInt("id",0);
        grade_id = jsonObject.optInt("grade_id",0);
        grade_name = jsonObject.optString("grade_name","");
        semester = jsonObject.optString("semester","UP");
        subject_id = jsonObject.optInt("subject_id",0);
        subject_name = jsonObject.optString("subject_name","");
        press_id = jsonObject.optInt("press_id",0);
        press_name = jsonObject.optString("press_name","");
        press_desc = jsonObject.optString("press_desc","");
        cover = jsonObject.optString("cover","");
        level = jsonObject.optInt("level",0);
        level_json = jsonObject.optString("level_json","");
        defaultPress = jsonObject.optInt("default",0);
    }
}
